﻿using Quartz;
using System.Diagnostics.CodeAnalysis;
using XJay.Scheduler.JobEntity;
using XJay.Scheduler.JobEntity.Base;

namespace XJay.Scheduler
{
    public interface ISchedulerrManger
    {
        /// <summary>
        /// 开启调度器
        /// </summary>
        /// <returns></returns>
        Task<bool> StartSchedulerAsync();
        /// <summary>
        /// 添加一个Cron类型Job
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        Task AddCronJobAsync(CronEntity param);
        /// <summary>
        /// 删除一个Job
        /// </summary>
        /// <param name="jobkey"></param>
        /// <returns></returns>
        Task<bool> DeleteJobAsync(JobKey jobkey);
        /// <summary>
        /// 为xxJob添加一个触发器
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        Task AddTriggerJobAsync(TriggerEntity triggerEntity);
    }
}
